package mysql

import "gorm.io/gorm"

type Order struct {
	gorm.Model
	UserId  int     `gorm:"type:int;not null;index:ip_idx"`
	OrderSn string  `gorm:"type:varchar(50);not null;index:ip_idx"`
	Amount  float64 `gorm:"type:decimal(10,2);not null;index:ip_idx"`
	Payment string  `gorm:"type:enum('微信','支付宝');not null;index:ip_idx"`
	Status  string  `gorm:"type:enum('已支付','未支付');not null;index:ip_idx"`
}

func (o *Order) List() (order []*Order) {
	DB.Debug().Find(&order)
	return
}
